using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;


public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
                
        Session["usuario"] = Login1.UserName.ToString();        
        
        
        
        SqlConnection conexion = null;
        string ruta="~/imagen/logo.JPG";
        string iconos = "~/imagenSoft/";
        try
        {
            conexion = Conexion.CrearConexion();
            IDbCommand comando = Conexion.CrearComando(conexion);
            comando.CommandText = "select *  from Config where cod_config= (SELECT MAX(cod_config) FROM Config)";            
            IDataReader resultado = comando.ExecuteReader();
            while (resultado.Read())
            {
                ruta = resultado["logo"].ToString();
                iconos = resultado["estilo"].ToString();

            }
        }
        finally
        {
            conexion.Dispose();
        }

        Session["logo"] = ruta;
        Session["ruta"] = iconos;
       

    }
}
